using Blackbird.Common.Utility;
using Blackbird.Core.Editable.Map;
using Microsoft.Xna.Framework.Content.Pipeline;

namespace Blackbird.Pipeline
{
    /// <summary>
    /// This class will be instantiated by the XNA Framework Content Pipeline
    /// to import a file from disk into the specified type, TImport.
    /// 
    /// This should be part of a Content Pipeline Extension Library project.
    /// 
    /// TODO: change the ContentImporter attribute to specify the correct file
    /// extension, display name, and default processor for this importer.
    /// </summary>
    [ContentImporter(".map", DisplayName = "Map Importer", DefaultProcessor = "MapProcessor")]
    public class MapImporter : ContentImporter<EditableMapLayer>
    {
        public override EditableMapLayer Import(string filename, ContentImporterContext context)
        {
            return SerializationUtility.CreateFromFile<EditableMapLayer>(filename);
        }
    }
}